Skip to content

SynchronizeWitness class

Defined in

Namespace: ReactiveUI.Primitives.Advanced Assembly: ReactiveUI.Primitives.Core.dll Full name: ReactiveUI.Primitives.Advanced.SynchronizeWitness<T> Modifiers: public sealed

Summary

View source

Observer that serializes notifications behind a gate so downstream operators always observe the single-threaded OnNext* then OnError|OnCompleted grammar they depend on, even when the upstream source delivers concurrently. Stateful sinks (counting, distinct, buffering) rely on that grammar; placing one of these ahead of them is the supported way to consume a non-conformant source.

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Class hierarchy
classDiagram
class SynchronizeWitness~T~
class IObserver~T~ {
    <>
}
IObserver~T~ <|.. SynchronizeWitness~T~
class IDisposable {
    <>
}
IDisposable <|.. SynchronizeWitness~T~

Implements: IObserver, IDisposable

Constructors

NameSummary
.ctorInitializes a new instance of the [SynchronizeWitness](# class with a private gate.

Methods

NameSummary
OnNext
OnError
OnCompleted
SetSubscriptionAssigns the upstream subscription, disposing it if one is already held.
Dispose
Inherited members